package com.google.code.msgbooster.core;

import javax.jdo.PersistenceManager;

public abstract class Meta {	

	protected enum TYPE {
		BATCH, CORE, PORTAL
	}

	protected static void ERROR(TYPE type, Class<?> sender, Exception exception) {
		exception.printStackTrace();
	}

	protected static void INFO(TYPE type, Class<?> sender, String message) {

	}

	protected static void WARN(TYPE type, Class<?> sender, String message,
			Exception exception) {
		exception.printStackTrace();
	}

	protected final String getProperty(String key) {
		return Config.getProperty(key);
	}

	protected int getRetryTimes() {
		int result = 3;
		String retryTimes = getProperty("msgbooster.retry.times");
		if (retryTimes != null) {
			result = Integer.valueOf(retryTimes);
		}
		return result;
	}

	protected String getDefaultCharset() {
		return getProperty("msgbooster.default.charset");
	}

	protected static PersistenceManager getPersistenceManager() {
		return Service.getPersistenceManager();
	}

}
